home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / self / contrib.lha / contrib / SelfNews / tEdit.self < prev    next >
Text File  |  1993-07-24  |  1KB  |  57 lines

  1.  "File tEdit.self
  2.  created by Ian Wilkinson on Mon Oct 12 17:52:40 1992
  3.  
  4.  Copyright (c) Canon Research Centre Europe, 1992.
  5.  All rights reserved."
  6.  
  7. traits applications visualiser _AddSlotsIfAbsent: ( | ^ tEdit = () | )
  8. traits tEdit _Define: ( | 
  9.     _ parent* = traits clonable.
  10.  
  11.     ^ fashion = ( copy initialize ).
  12.     ^ initialize = (
  13.     jotW: wireI open loadPackages.
  14.     jotI initialize: jotW.
  15.     textHolder: jotText newText: initialSz.
  16.     formatter: jotView newViewFor: textHolder On: jotW.
  17.     ruler: jotRuler newRuler.
  18.     ruler initialiseFontFor: textHolder In: formatter.
  19.     self
  20.     ).
  21.  
  22.     ^ setReadOnly: isProtected = ( formatter setReadOnly: isProtected ).
  23.  
  24.     ^ placeAtEnd: text = ( textHolder placeAtEnd: text ).
  25.  
  26.     ^ synthesizeWithoutInteraction = (
  27.     visualisation: fabricateTEdit on: formatter canvas Media: jotW.
  28.     formatter behaviour do: [ | :aspect |
  29.         visualisation behaviourFor: self On: aspect Is: 'formatterCalling'.
  30.     ].
  31.     visualisation construction
  32.     ).
  33.  
  34.     ^ contents = ( | s |
  35.     s: mutableString copySize: textHolder size + 1 FillingWith: ' '.
  36.     textHolder contentsInto: s.
  37.     s
  38.     ).
  39.  
  40.     ^ formatterCalling = ( formatter respond )
  41. | )
  42.  
  43. prototypes visualiser _AddSlotsIfAbsent: ( | ^ tEdit = () | )
  44. tEdit _Define: ( |
  45.     _ parent* = traits tEdit.
  46.     _ thisObjectPrints = true.
  47.  
  48.     ^ visualisation <- fabricateTEdit.
  49.     ^ jotW.
  50.     ^ textHolder.
  51.     ^ formatter.
  52.     ^ ruler.
  53.     _ initialSz     = 1024.
  54.  
  55.     ^ printString = 'a tEdit'
  56. | )
  57.